<template>
  <div class="alterCover" @click.self="closeDeleteBox">
    <div class="deleteMain">
      <div class="title">
        <p>{{title}}</p>
        <i class="el-icon-close" @click="closeDeleteBox"></i>
      </div>
      <div class="main">
        <slot />
      </div>
      <div class="btn flex-center" v-if="showBtn">
        <div class="cancel flex-center" @click="closeDeleteBox">取消</div>
        <div class="deterMine flex-center"  @click="Confirm">确定</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    title: {
      require: String,
      default: ''
    },
    showBtn: {
      require: Boolean,
      default: true
    }
  },
  methods: {
    closeDeleteBox () {
      this.$emit('Cancel')
    },
    // 确认添加/编辑
    Confirm () {
      this.$emit('Confirm')
    }

  },
  created () {
  }
}
</script>

<style lang="scss" scoped>
.alterCover{
  z-index: 188;
  position: fixed;
  top: 0;
  left: 0;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.5);
}
.deleteMain {
  position: fixed;
  z-index: 999;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 840px;
  height: 720px;
  background: rgba(255, 255, 255, 1);
  border-radius: 5px;
  .warn{
    width:20px;
    height:20px;
    border-radius: 50%;
    line-height: 20px;
    font-size: 15px;
    color: #fff;
    display: inline-block;
    background:rgba(255,180,21,1);
  }
  .title {
    position: relative;
    height: 72px;
    border-bottom: 1px solid rgba(242, 242, 242, 1);
    p {
      position: absolute;
      font-size: 18px;
      font-weight: 500;
      color: rgba(51, 51, 51, 1);
      line-height: 72px;
      padding-left: 20px;
    }
    .el-icon-close {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: 23px;
      cursor: pointer;
      line-height: 72px;
      font-size: 18px;
    }
  }
  .main {
    position: relative;
    height: 176px;
    width: 100%;
    .determine {
      position: absolute;
      top: 59px;
      text-align: center;
      width: 100%;
      font-size: 18px;
      height: 26px;
      line-height: 26px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
    .after {
      width: 100%;
      position: absolute;
      top: 104px;
      font-size: 14px;
      text-align: center;
    }
    .deleteInfo {
      position: absolute;
      top: 60px;
      // left: 50%;
      text-align: center;
      width: 100%;
      // transform: translateX(-50%);
      font-size: 18px;
      font-weight: 400;
      color: rgba(51, 51, 51, 1);
    }
  }
  .btn {
    height: 112px;
    width: 100%;
    position: absolute;
    bottom: 0;
    .cancel {
      cursor: pointer;
      width: 128px;
      height: 48px;
      border-radius: 28px;
      font-size: 18px;
      color: rgba(72, 104, 255, 1);
      border: 2px solid rgba(72, 104, 255, 1);
    }
    .deterMine {
      cursor: pointer;
      margin-left: 25px;
      width: 128px;
      height: 48px;
      font-size: 18px;
      background: rgba(72, 104, 255, 1);
      border-radius: 28px;
      color: rgba(255, 255, 255, 1);
    }
  }
}
</style>
